
#include <ctime>
#include "Utility.hpp"

using namespace huluwa;
using namespace std;

string huluwa::GetTimeStamp()
{
    char   timeBuf[128];
    time_t tmpTime;
    struct tm *curTime;

    time(&tmpTime);
    curTime = localtime(&tmpTime);

    strftime(timeBuf, sizeof(timeBuf) - 1, "%Y-%m-%d %H:%M:%S", curTime);

    timeBuf[sizeof(timeBuf) - 1] = 0;

    return timeBuf;
}
